import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Login',
      component: ()=>import('../views/LoginView.vue')
    },
    {
      path: '/Main',
      name: 'Main',
      component: () => import('../views/AboutView.vue'),
      children:[
        {
          path: '/UserInfoAdd',
          name: 'UserInfoAdd',
          component: () => import('../views/UserInfo/UserInfoAdd.vue')
        },
        {
          path: '/UserInfoList',
          name: 'UserInfoList',
          component: () => import('../views/UserInfo/UserInfoList.vue')
        },
        {
          path: '/UserInfoUpda',
          name: 'UserInfoUpda',
          component: () => import('../views/UserInfo/UserInfoUpda.vue')
        },
        {
          path: '/RoleAdd',
          name: 'RoleAdd',
          component: () => import('../views/Role/RoleAdd.vue')
        },
        {
          path: '/RoleList',
          name: 'RoleList',
          component: () => import('../views/Role/RoleList.vue')
        },
        {
          path: '/RoleUpda',
          name: 'RoleUpda',
          component: () => import('../views/Role/RoleUpda.vue')
        },//菜单
        {
          path: '/MenuAdd',
          name: 'MenuAdd',
          component: () => import('../views/Menu/MenuAdd.vue')
        },
        {
          path: '/MenuList',
          name: 'MenuList',
          component: () => import('../views/Menu/MenuList.vue')
        },
        {
          path: '/MenuUpda',
          name: 'MenuUpda',
          component: () => import('../views/Menu/MenuUpda.vue')
        },
        {
          path: '/PrivilegLIst',
          name: 'PrivilegLIst',
          component: () => import('../views/Menu/PrivilegLIst.vue')
        },
        {
          path: '/ExcusedAdd',
          name: 'ExcusedAdd',
          component: ()=>import('../views/Excused/ExcusedAdd.vue')
        },
        {
          path: '/ExcusedList',
          name: 'ExcusedList',
          component: ()=>import('../views/Excused/ExcusedList.vue')
        },
        {
          path: '/ExcusedUpda',
          name: 'ExcusedUpda',
          component: ()=>import('../views/Excused/ExcusedUpda.vue')
        },
        {
          path: '/VettingUpda',
          name: 'VettingUpda',
          component: ()=>import('../views/Excused/VettingUpda.vue')
        },
        //溯源管理
        {
          path: '/TraceList',
          name: 'TraceList',
          component: ()=>import('../views/Traceability/TraceList.vue')
        },
        //溯源详情
        {
          path: '/TraceDetail',
          name: 'TraceDetail',
          component: ()=>import('../views/Traceability/TraceDetail.vue'),
          children:[
            {
              path: '/TraceFarming',
              name: 'TraceFarming',
              component: ()=>import('../views/Traceability/TraceFarming.vue')
            },
            {
              path: '/TraceCarcass',
              name: 'TraceCarcass',
              component: ()=>import('../views/Traceability/TraceCarcass.vue')
            },
            {
              path: '/TraceCarcass',
              name: 'TraceCarcass',
              component: ()=>import('../views/Traceability/TraceCarcass.vue')
            },
          ]
        },
      ]
    },
    //手机端溯源管理
    {
      path: '/MobileList',
      name: 'MobileList',
      component: ()=>import('../views/Traceability/MobileList.vue')
    },
  ]
})

export default router
